home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
pd
/
netz
/
term
/
extras
/
source
/
gtlayout-source.lha
/
LTP_DrawBackFore.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-25
|
1KB
|
58 lines
/* GadTools layout toolkit
**
** Copyright © 1993-1995 by Olaf `Olsen' Barthel
** Freely distributable.
*/
#include "gtlayout_global.h"
#ifdef DO_TAPEDECK_KIND
VOID __regargs
LTP_DrawBackFore(struct RastPort *RPort,BOOLEAN Back,LONG Left,LONG Top,LONG Width,LONG Height)
{
LONG i,Len,Start,ArrowWidth,ArrowHeight,Shift;
ArrowWidth = Width / 2;
ArrowHeight = Height;
Left = Left + (Width - ArrowWidth) / 2;
Shift = ArrowWidth / 2;
if(Back)
{
for(i = 0 ; i < ArrowWidth ; i++)
{
Len = ((ArrowHeight * (i + 1)) / ArrowWidth) & ~1;
if(Len < ArrowHeight)
Len++;
Start = Top + (ArrowHeight - Len) / 2;
Move(RPort,Left + i - Shift,Start);
Draw(RPort,Left + i - Shift,Start + Len - 1);
Move(RPort,Left + i + Shift,Start);
Draw(RPort,Left + i + Shift,Start + Len - 1);
}
}
else
{
for(i = 0 ; i < ArrowWidth ; i++)
{
Len = ((ArrowHeight * (i + 1)) / ArrowWidth) & ~1;
if(Len < ArrowHeight)
Len++;
Start = Top + (ArrowHeight - Len) / 2;
Move(RPort,Left + ArrowWidth - 1 - i - Shift,Start);
Draw(RPort,Left + ArrowWidth - 1 - i - Shift,Start + Len - 1);
Move(RPort,Left + ArrowWidth - 1 - i + Shift,Start);
Draw(RPort,Left + ArrowWidth - 1 - i + Shift,Start + Len - 1);
}
}
}
#endif /* DO_TAPEDECK_KIND */